#include <iostream>
#include <thread>
#include "MutexLock.h"
#include "MutexLockGuard.h"
using std::cout;
using std::endl;
using std::thread;

int cnt = 0;
MutexLock mutexLock;
void threadFunc(void){
    for(size_t idx = 0; idx != 1000000; ++idx){
        MutexLockGuard mutexLockGuard(mutexLock);
        cnt++;
    }
}


int main(void) {
    thread th1(threadFunc);
    thread th2(threadFunc);

    th1.join();
    th2.join();

    cout << cnt << endl;
    return 0;
}
